package com.example.hjt_java_web_homework3.service;

import com.example.hjt_java_web_homework3.dao.EnvironmentDataDao;
import com.example.hjt_java_web_homework3.model.EnvironmentData;

import java.util.List;

/**
 * @author Li Chun Hei
 * @date 31/10/2025
 * @description
 */
public class EnvironmentDataService {
    private EnvironmentDataDao environmentDataDao = new EnvironmentDataDao();

    public boolean recordEnvironmentData(EnvironmentData data) {
        return environmentDataDao.save(data);
    }

    public List<EnvironmentData> getAllEnvironmentData() {
        return environmentDataDao.findAll();
    }

    public List<EnvironmentData> getEnvironmentDataByLocation(String location) {
        return environmentDataDao.findByLocation(location);
    }
}
